import React from "react";
// children 表示该组件的子节点。childrenProps一样
const Hello = (props) => {
  console.log(props);
  return <div><h1>{props.children}</h1></div>;
};
// 传递函数
const HelloDay = (props) => {
  props.children("hello内部")
  
  return <div></div>;
};

export  default class App extends React.Component {
  render() {
    return (
      <div>
        <Hello>{[1, 2, 4].join("--")}</Hello>

        <HelloDay>
          {(str) => {
            console.log("day", str);
          }}·1
        </HelloDay>
      </div>
    );
  }
}
